﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Mvc;
namespace Tencent.OABanche.App
{
   

    /// <summary>
    ///  片区维护绑定
    /// </summary>
    public class CorporationAreaModelBinder : IModelBinder
    {
        //#region IModelBinder 成员
        ///// <summary>
        ///// 控件前缀
        ///// </summary>
        //private const string CONTROL_PREFIX = "tx_";

        //public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        //{
        //    if (controllerContext == null)
        //        throw new ArgumentNullException("controllerContext");
        //    ///获取所有以tx_开头的字符
        //    string[] areas = controllerContext.HttpContext.Request.Form.AllKeys.Where(o => o.StartsWith(CONTROL_PREFIX)).ToArray();
        //    List<CorporationArea> areaList = new List<CorporationArea>();
        //    if (areas != null && areas.Length > 0)
        //    {
        //        foreach (string key in areas)
        //        {                    
        //            areaList.Add(new CorporationArea()
        //            {                       
        //                areaName = controllerContext.HttpContext.Request.Form[key]
        //            });
        //        }
        //    }
        //    return areaList;
        //}

        //#endregion
        #region IModelBinder 成员

        public object BindModel(ControllerContext controllerContext, ModelBindingContext bindingContext)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
